package com.web.treatment;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.service.TreatmentsService;
import com.util.AuthenticateHttpServlet;

@WebServlet("/Treatment/PriceEdit")
public class TreatmentPriceEdit extends AuthenticateHttpServlet {

	@Override
	protected void post(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		TreatmentsService service = new TreatmentsService();
		String code = request.getParameter("code");
		float salesPrice = Float.parseFloat(request.getParameter("salesPrice"));
		service.updateTreatmentPrice(code, salesPrice);
		request.getRequestDispatcher("/Treatment/List").forward(request,
				response);	}

}
